<div class="am-u-sm-12 widget main-w">
	{if $notPopup}
	<ol class="am-breadcrumb">
		<li>
			<a href="{:url('/admin/index')}">首页</a>
		</li>
		<li>
			<a href="{:url('/admin/car/index')}">业务管理</a>
		</li>
		<li>
			<a href="{:url('index')}">公司管理</a>
		</li>
		
	</ol>
	{/if}
	<form class="am-form-inline tpl-form-border-form" action="" method="get">
		<input type="hidden" name="op" value="{$Think.get.op}"/>
		<div class="am-u-sm-12 cl-p">
			<div class="am-u-sm-3">
				<input type="hidden" name="filter" value="{:input('param.filter')}"/>
				<input type="text" class="am-form-field tpl-form-no-bg" name="company_name" placeholder="公司名称" value="{$Think.get.company_name}">
			</div>
			<div class="am-form-group am-u-sm-1">
				<select  name="company_mode" style="height: 33px;" >
					<option value="" selected>公司类型</option>
					<option {$Think.get.company_mode==1? selected:''} value="1">单位</option>
					<option {$Think.get.company_mode==2? selected:''} value="2">服务公司</option>
					<!--{$props}-->
				</select>
			</div>
			<div class="am-form-group am-u-sm-3">
				<select  name="prop" style="height: 33px;" >
					<option {$Think.get.prop? '':selected} value="">单位性质-全部</option>
					<option {$Think.get.prop==1? selected:''} value="1">政府机关单位</option>
					<option {$Think.get.prop==11? selected:''} value="11">政府机关单位-市直</option>
					<option {$Think.get.prop==12? selected:''} value="12">政府机关单位-乡镇</option>
					<option {$Think.get.prop==13? selected:''} value="13">政府机关单位-四办</option>
					<option {$Think.get.prop==2?selected:''} value="2">事业单位</option>
					<option {$Think.get.prop==3? selected:''} value="3">国营单位</option>
					<option {$Think.get.prop==4? selected:''} value="4">民营企业</option>
					<option {$Think.get.prop==5? selected:''} value="5">公检法</option>
					<!--{$props}-->
				</select>
			</div>
			<div class="am-u-sm-5">
				<button type="submit" class="am-btn am-btn-primary am-radius am-btn-sm">查询<i class="am-icon-search"></i></button>
			</div>

		</div>
		<div class="am-u-sm-12" style="padding: 10px;">
			{if $op == 'search'} {else/} {if $Think.get.filter}
			<div class="am-btn-group am-u-sm-12 am-btn-group-xs cl-p">
				<a href="{:url('index')}" class="am-btn am-btn-default">
					</span> 查看可用公司</a>
				<!--<button type="button" class="am-btn am-btn-default am-fr" style="float: right;">导出数据</button>-->
			</div>
			{else/}
			<div class="am-btn-group am-u-sm-12 am-btn-group-xs cl-p">
				<a href="{:url('add')}" class="am-btn am-btn-default"><span class="am-icon-plus"></span> 新增</a>
				<button type="button" class="am-btn am-btn-default delete-multiple" data-method='deleteMultiple'><span class="am-icon-trash-o"></span> 删除</button>
				<!--<button type="button" class="am-btn am-btn-default">短信发送</button>-->
				<a href="{:url('index')}?filter=delete" class="am-btn am-btn-default">查看已删除公司</a>
				<!--<button type="button" class="am-btn am-btn-default am-fr" style="float: right;">导出数据</button>-->
			</div>
			{/if} {/if}

			<table width="100%" class="am-table am-table-compact am-table-bordered am-table-radius am-table-striped am-text-truncate tpl-table-black" id='used'>
				<thead>
					<tr data-id="{$item.company_id}">
						{if $op == 'search'}
						<th>操作</th>
						{else/}
						<th><input type="checkbox" data-checkall='1' class="check-all" /></th>
						{/if}
						<th>公司名称</th>
						<th>公司类型</th>
						<th>账号</th>
						{if $op == 'search'} {else/} {/if}
						<th>单位额度</th>
						<th>单位余额</th>
						<th>财政额度</th>
						<th>财政余额</th>
						<!--<th>充值记录</th>-->
						<th>联系人</th>
						<th>联系电话</th>
						<th>状态</th>
						{if $op == 'search'} {else/}
						<th>详情</th>
						<th>操作</th>
						{/if}
					</tr>
				</thead>
				<tbody>
					{foreach $list as $key => $item}
					<tr data-id="{$item.company_id}" >
						{if $op == 'search'}
						<td>
							<div class="tpl-table-black-operation">
								<a href="javascript:;" class="choose" data-id="{$item.company_id}" data-name="{$item.company_name}">
									<i class="am-icon-pencil"></i> 选中
								</a>
							</div>
						</td>
						{else/}
						<th><input type="checkbox" class="check-list" /></th>
						{/if}
						<td>
							{$item.company_name}
						</td>
						<td>{$item.company_mode == 1?'单位':'服务公司'}</td>
						<td>{$item.account?:无账号}</td>

						<td>{$item.unit_quota?:"-"}</td>
                        <td>{$item.unit_quota-$item.used_unit_quota}</td>
						<td>{$item.quota?:"-"}</td>
						<td>{$item.quota-$item.used_quota}</td>
						<td>{$item.linkman?:"-"}</td>
						<td>{$item.phone?:"-"}</td>
						<td class="am-text-{$item.state==9?'danger':'success'}">{$item.state==9?'已禁用':'已启用'}</td>
						{if $op == 'search'} {else/}
						<td>
							<div class="tpl-table-black-operation">
								<a class="detail">
									<i class="am-icon-pencil"></i> 查看
								</a>
							</div>
						</td>
						<td data-id="{$item.company_id}">
							<div class="tpl-table-black-operation">
								{if $item.state == 9}
								<a href="javascript:;" class="startusing" data-method="startusing">
									<i class="am-icon-pencil"></i> 启用
								</a>
								{else/}
								<a href="javascript:;" class="tpl-table-black-operation-del forbidden" data-method="forbidden">
									<i class="am-icon-trash"></i> 禁用
								</a>
								<a href="{:url('unit/login/adminLogin',['cid'=>$item.company_id,'token'=>$item.m_cid])}" target="_blank" data-method="forbidden">
									<i class="am-icon-pencil"></i> 管理
								</a>
								{/if}
								<a href="{:url('edit',['company_id'=>$item.company_id])}">
									<i class="am-icon-pencil"></i> 编辑
								</a>
								<a href="javascript:;" class="tpl-table-black-operation-del delete-list" data-method="delete">
									<i class="am-icon-pencil"></i> 删除
								</a>
								<!--<a href="{:url('edit',['company_id'=>$item.company_id])}">
									<i class="am-icon-pencil"></i> 重置
								</a>-->
							</div>
						</td>
						{/if}
					</tr>
					{/foreach}
					<!-- more data -->
				</tbody>
			</table>
			<div class="am-u-lg-12 am-cf">
				<div class="am-fr">
					{$pager}
				</div>
			</div>
		</div>
	</form>
</div>